<template>
    <div style="width: 100%">
        <el-rate v-if="!isInstanceSearch" :style="selectStyle" :disabled="isDisable"
                 v-model="properties.bindValue" :max="properties.max" :allow-half="properties.isAllowHalf"
                :show-score="properties.isShowScore" :score-template="properties.scoreTemplate"/>

        <el-rate v-if="isInstanceSearch" :style="selectStyle" :disabled="isDisable"
                 v-model="properties.searchValue" :max="properties.max" :allow-half="properties.isAllowHalf"
                 :show-score="properties.isShowScore" :score-template="properties.scoreTemplate"/>
    </div>
</template>

<script setup lang="ts" name="YwuFormRate">
import {computed, defineProps} from "vue";

let props = defineProps(['isEdit', 'properties', 'isInstanceSearch', "isDisable", "formBuildList"]);

let isEdit = computed(() => {return props['isEdit']})
let properties = computed(() => {return props['properties']})
let isInstanceSearch = computed(() => {return props['isInstanceSearch']})
let isDisable = computed(() => {return props['isDisable']})
let formBuildList = computed(() => {return props['formBuildList']})

let selectStyle = computed(() => {
    if (isEdit.value) {
        return "pointer-events: none;"
    } else {
        return "";
    }
})
</script>

<style scoped lang="less">

</style>